package com.ecelin;

import com.bstek.ureport.console.UReportServlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;

@SpringBootApplication
@ImportResource(value = {"classpath:content.xml"})
public class MainApp {
	public static void main(String[] args) {
		SpringApplication.run(MainApp.class, args);
		System.out.println("--------------------------------------------------------");
		System.out.println("http://localhost/ureport/designer");
		System.out.println("--------------------------------------------------------");
	}

	@Bean
	public ServletRegistrationBean buildUReportServlet() {
		return new ServletRegistrationBean(new UReportServlet(), "/ureport/*");
	}
}
